package com.lagou.config;

import com.lagou.handler.UserServerHandler;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;

//@Configuration
public class RpcHandlerConfig implements ApplicationContextAware {
    private ApplicationContext applicationContext;
    @Bean
    public UserServerHandler userServerHandler(){
        return new UserServerHandler(applicationContext);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }
}
